<template>
	<!-- <view class="report"> -->
		<view class="constellation">
			<view  v-if="!auditShow">
				<other></other>
			</view>
			<!-- 自定义导航栏 -->
			<uni-nav-bar background-color="#ffffff"
			 color="#0b2659" :border="false" :fixed="true"
			  @clickLeft="left"  left-icon="left" 
			   leftWidth="50rpx" rightWidth="10rpx" 
			   :statusBar="true"  
			  
			   >
			   <!-- :height="`${88 + statusBarHeight*2}rpx`"
			     :style="{ paddingTop: statusBarHeight + 'px' }" -->
			   <view class="title_box">
			 	 <view class="left">
					<view class="left_text">
						综合报告
					</view>
				<!-- 	<view class="left_icon">
						<uni-icons color="#0b2659" @click="idcard=!idcard" v-if="idcard" type="down" size="14"></uni-icons>
					    <uni-icons color="#0b2659" @click="idcard=!idcard" v-else type="up" size="14"></uni-icons>
					</view> -->
				</view>
			 	<view class="right">
			 	<!-- <uni-icons @click="userChange" color="#0b2659" style="margin-right: 20rpx;" custom-prefix="iconfont" type="icon-shenfenqiehuan" size="20"></uni-icons> -->
			 	<!-- <uni-icons color="#0b2659" custom-prefix="iconfont" type="icon-fenxiang" size="22"></uni-icons> -->
			 	</view>
			   </view>
			</uni-nav-bar>
			
			
		 
		<view class="cont_box">
			<!-- tab切换栏 -->
			<view class="tab">
				<view class="tab_left">
					<view @click="number1=0" class="shengchen" :class="number1===0?'active':' '">
						<view class="tetx">
							生辰
						</view>
						<view class="line">
							
						</view>
					</view>
					<view @click="number1=1" class="liupan" :class="number1===1?'active':' '">
						<view class="text">
							流盘
						</view>
						<view class="line">
							
						</view>
					</view>
				</view>
				<view class="tab_right">
				</view>
			</view>
			<!-- 排盘 -->
			<view class="paipan" v-if="number1==0">
				<view class="pai_title">
					<view class="kong item">
						
					</view>
					<view class="item">
						年柱
					</view>
					<view class="item">
						月柱
					</view>
					<view class="item">
						日主
					</view>
					<view class="item">
						时柱
					</view>
					
				</view>
				<view class="ganshen" v-if="shishen">
					<view class="title item">
						干神
					</view>
					<view class="item">
						{{shishen.nianShen}}
					</view>
					<view class="item">
						{{shishen.yueShen}}
					</view>
					<view class="item">
						{{shishen.riShen}}
					</view>
					<view class="item">
						{{shishen.shiShen}}
					</view>
				</view>
				<view class="tiangan" v-if="baziInfo">
					<view class="title item">
						天干
					</view>
					<view class=" item">
						<view v-if="nianZhuTian.wuXing == '金'" style="color: #e7950e;">{{nianZhuTian.tianGan}}</view>
						<view v-if="nianZhuTian.wuXing == '木'" style="color: #2de24e;">{{nianZhuTian.tianGan}}</view>
						<view v-if="nianZhuTian.wuXing == '水'" style="color: #3083f7;">{{nianZhuTian.tianGan}}</view>
						<view v-if="nianZhuTian.wuXing == '火'" style="color: #d10600;">{{nianZhuTian.tianGan}}</view>
						<view v-if="nianZhuTian.wuXing == '土'" style="color: #876d07;">{{nianZhuTian.tianGan}}</view>
						
					</view>
					<view class="item">
						<view v-if="yueZhuTian.wuXing == '金'" style="color: #e7950e;">{{yueZhuTian.tianGan}}</view>
						<view v-if="yueZhuTian.wuXing == '木'" style="color: #2de24e;">{{yueZhuTian.tianGan}}</view>
						<view v-if="yueZhuTian.wuXing == '水'" style="color: #3083f7;">{{yueZhuTian.tianGan}}</view>
						<view v-if="yueZhuTian.wuXing == '火'" style="color: #d10600;">{{yueZhuTian.tianGan}}</view>
						<view v-if="yueZhuTian.wuXing == '土'" style="color: #876d07;">{{yueZhuTian.tianGan}}</view>
						
					</view>
					<view class="item">
						<view v-if="riZhuTian.wuXing == '金'" style="color: #e7950e;">{{riZhuTian.tianGan}}</view>
						<view v-if="riZhuTian.wuXing == '木'" style="color: #2de24e;">{{riZhuTian.tianGan}}</view>
						<view v-if="riZhuTian.wuXing == '水'" style="color: #3083f7;">{{riZhuTian.tianGan}}</view>
						<view v-if="riZhuTian.wuXing == '火'" style="color: #d10600;">{{riZhuTian.tianGan}}</view>
						<view v-if="riZhuTian.wuXing == '土'" style="color: #876d07;">{{riZhuTian.tianGan}}</view>
						
					</view>
					<view class="item">
						<view v-if="shiZhuTian.wuXing == '金'" style="color: #e7950e;">{{shiZhuTian.tianGan}}</view>
						<view v-if="shiZhuTian.wuXing == '木'" style="color: #2de24e;">{{shiZhuTian.tianGan}}</view>
						<view v-if="shiZhuTian.wuXing == '水'" style="color: #3083f7;">{{shiZhuTian.tianGan}}</view>
						<view v-if="shiZhuTian.wuXing == '火'" style="color: #d10600;">{{shiZhuTian.tianGan}}</view>
						<view v-if="shiZhuTian.wuXing == '土'" style="color: #876d07;">{{shiZhuTian.tianGan}}</view>
						
					</view>
					 
				</view>
				<view class="dizhi">
					<view class="title item">
						地支
					</view>
					<view class=" item">
						<view v-if="nianZhuDi.wuXing == '金'" style="color: #e7950e;">{{nianZhuDi.diZhi}}</view>
						<view v-if="nianZhuDi.wuXing == '木'" style="color: #2de24e;">{{nianZhuDi.diZhi}}</view>
						<view v-if="nianZhuDi.wuXing == '水'" style="color: #3083f7;">{{nianZhuDi.diZhi}}</view>
						<view v-if="nianZhuDi.wuXing == '火'" style="color: #d10600;">{{nianZhuDi.diZhi}}</view>
						<view v-if="nianZhuDi.wuXing == '土'" style="color: #876d07;">{{nianZhuDi.diZhi}}</view>
						
					</view>
					<view class="item">
						<view v-if="yueZhuDi.wuXing == '金'" style="color: #e7950e;">{{yueZhuDi.diZhi}}</view>
						<view v-if="yueZhuDi.wuXing == '木'" style="color: #2de24e;">{{yueZhuDi.diZhi}}</view>
						<view v-if="yueZhuDi.wuXing == '水'" style="color: #3083f7;">{{yueZhuDi.diZhi}}</view>
						<view v-if="yueZhuDi.wuXing == '火'" style="color: #d10600;">{{yueZhuDi.diZhi}}</view>
						<view v-if="yueZhuDi.wuXing == '土'" style="color: #876d07;">{{yueZhuDi.diZhi}}</view>
						
					</view>
					<view class="item">
						<view v-if="riZhuDi.wuXing == '金'" style="color: #e7950e;">{{riZhuDi.diZhi}}</view>
						<view v-if="riZhuDi.wuXing == '木'" style="color: #2de24e;">{{riZhuDi.diZhi}}</view>
						<view v-if="riZhuDi.wuXing == '水'" style="color: #3083f7;">{{riZhuDi.diZhi}}</view>
						<view v-if="riZhuDi.wuXing == '火'" style="color: #d10600;">{{riZhuDi.diZhi}}</view>
						<view v-if="riZhuDi.wuXing == '土'" style="color: #876d07;">{{riZhuDi.diZhi}}</view>
						
					</view>
					<view class="item">
						<view v-if="shiZhuDi.wuXing == '金'" style="color: #e7950e;">{{shiZhuDi.diZhi}}</view>
						<view v-if="shiZhuDi.wuXing == '木'" style="color: #2de24e;">{{shiZhuDi.diZhi}}</view>
						<view v-if="shiZhuDi.wuXing == '水'" style="color: #3083f7;">{{shiZhuDi.diZhi}}</view>
						<view v-if="shiZhuDi.wuXing == '火'" style="color: #d10600;">{{shiZhuDi.diZhi}}</view>
						<view v-if="shiZhuDi.wuXing == '土'" style="color: #876d07;">{{shiZhuDi.diZhi}}</view>
						
					</view>
				</view>
			<view class="znaggan" v-if="cangGan">
			   	 <view class="title item">
			   		臧干
			   	 </view>
				
				 <view class="item">
					<view class="item_i" v-for="(item,index) in cangGan.nianGan">
						{{item}}
					</view>
				 </view>
				 <view class="item">
					<view class="item_i" v-for="(item,index) in cangGan.yueGan">
						{{item}}
					</view>
				  </view>
				  <view class="item">
					<view class="item_i" v-for="(item,index) in cangGan.riGan">
						{{item}}
					</view>
				  </view>
				   <view class="item">
					<view class="item_i" v-for="(item,index) in cangGan.shiGan">
						{{item}}
					</view>
				   </view>
			   </view>
			<view class="naYins" v-if="nayin">
			     	<view class="title item">
			     		纳音
			     	</view>
			     	<view class="item">
			     		{{nayin.nianYin}}
			     	</view>
			     	<view class="item">
			     		{{nayin.yueYin}}
			     	</view>
			     	<view class="item">
			     		{{nayin.riYin}}
			     	</view>
			     	<view class="item">
			     		{{nayin.shiYin}}
			     	</view>
			     </view>
				 <view class="changheng" v-if="changsheng">
				     	<view class="title item">
				     		长生
				     	</view>
				     	<view class="item">
				     		{{changsheng.nianSheng}}
				     	</view>
				     	<view class="item">
				     		{{changsheng.yueSheng}}
				     	</view>
				     	<view class="item">
				     		{{changsheng.riSheng}}
				     	</view>
				     	<view class="item">
				     		{{changsheng.shiSheng}}
				     	</view>
				    </view>
			<!-- paipan -->
		
		
	</view>
		<view class="jiedu" v-if="number1==0">
			<view class="top">
				<view class="title">
					生辰解读						
				</view>
				<view class="more" @click="tomore">
					<view class="button">
						更多解读
					</view>
				</view>
			</view>
			<view class="cont_text">
				{{dataInfo.xingGe}}
			</view>
			<view class="warn_text">
				<uni-icons   type="help" size="14" color="#949696"></uni-icons>
				当前内容仅供您在娱乐中探索自我，不等于专业测评，
						不代表价值评判，无任何现实指导意义。
			</view>
		</view>    
		<!-- 大运流年排盘 -->
		<view class="dayunpaipan" v-if="number1==1">
			<view class="cont_box">
				<view class="title_tab">
					<view class="item">
						
					</view>
					<view class="item">
						年柱
					</view>
					<view class="item">
						月柱
					</view>
					<view class="item">
						日柱
					</view>
					<view class="item">
						时柱
					</view>
					<view class="item">
						大运
					</view>
					<view class="item">
						流年
					</view>
					<view class="item">
					    流月
					</view>
					
				</view>
			    <view class="ganshen">
				 <view class="title item">
					干神
				 </view>
				 <view class="item">
					{{shishen.nianShen}}
				 </view>
				 <view class="item">
					{{shishen.yueShen}}
				 </view>
				 <view class="item">
					{{shishen.riShen}}
				 </view>
				 <view class="item">
					{{shishen.shiShen}}
				 </view>
				 <view class="item">
					{{currentnian.daYunShiShen}}
				 </view>
				 <view class="item">
					{{baziInfo.liuNianTianGanShiShen}}
				 </view>
				 <view class="item">
					{{baziInfo.liuYueTianGanShiShen}}
				 </view>
			    </view>
				<view class="tiangan">
					<view class="title item">
						天干
					</view>
					<view class=" item">
						<view v-if="baziInfo.nianZhu.tianGan.wuXing == '金'" style="color: #e7950e;">{{baziInfo.nianZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.nianZhu.tianGan.wuXing == '木'" style="color: #2de24e;">{{baziInfo.nianZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.nianZhu.tianGan.wuXing == '水'" style="color: #3083f7;">{{baziInfo.nianZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.nianZhu.tianGan.wuXing == '火'" style="color: #d10600;">{{baziInfo.nianZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.nianZhu.tianGan.wuXing == '土'" style="color: #876d07;">{{baziInfo.nianZhu.tianGan.tianGan}}</view>
						
					</view>
					<view class="item">
						<view v-if="baziInfo.yueZhu.tianGan.wuXing == '金'" style="color: #e7950e;">{{baziInfo.yueZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.yueZhu.tianGan.wuXing == '木'" style="color: #2de24e;">{{baziInfo.yueZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.yueZhu.tianGan.wuXing == '水'" style="color: #3083f7;">{{baziInfo.yueZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.yueZhu.tianGan.wuXing == '火'" style="color: #d10600;">{{baziInfo.yueZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.yueZhu.tianGan.wuXing == '土'" style="color: #876d07;">{{baziInfo.yueZhu.tianGan.tianGan}}</view>
						
					</view>
					<view class="item">
						<view v-if="baziInfo.riZhu.tianGan.wuXing == '金'" style="color: #e7950e;">{{baziInfo.riZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.riZhu.tianGan.wuXing == '木'" style="color: #2de24e;">{{baziInfo.riZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.riZhu.tianGan.wuXing == '水'" style="color: #3083f7;">{{baziInfo.riZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.riZhu.tianGan.wuXing == '火'" style="color: #d10600;">{{baziInfo.riZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.riZhu.tianGan.wuXing == '土'" style="color: #876d07;">{{baziInfo.riZhu.tianGan.tianGan}}</view>
						
					</view>
					<view class="item">
						<view v-if="baziInfo.shiZhu.tianGan.wuXing == '金'" style="color: #e7950e;">{{baziInfo.shiZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.shiZhu.tianGan.wuXing == '木'" style="color: #2de24e;">{{baziInfo.shiZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.shiZhu.tianGan.wuXing == '水'" style="color: #3083f7;">{{baziInfo.shiZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.shiZhu.tianGan.wuXing == '火'" style="color: #d10600;">{{baziInfo.shiZhu.tianGan.tianGan}}</view>
						<view v-if="baziInfo.shiZhu.tianGan.wuXing == '土'" style="color: #876d07;">{{baziInfo.shiZhu.tianGan.tianGan}}</view>
						
					</view>
					<view class="item">
						{{currentnian.daYun.slice(0,1)}}
					</view>
					<view class="item">
						{{baziInfo.liuNianTianGan}}
					</view>
					<view class="item">
						{{baziInfo.liuYueTianGan}}
					</view>
				</view>
				<view class="dizhi">
					<view class="title item">
						地支
					</view>
					<view class=" item">
						<view v-if="baziInfo.nianZhu.diZhi.wuXing == '金'" style="color: #e7950e;">{{baziInfo.nianZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.nianZhu.diZhi.wuXing == '木'" style="color: #2de24e;">{{baziInfo.nianZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.nianZhu.diZhi.wuXing == '水'" style="color: #3083f7;">{{baziInfo.nianZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.nianZhu.diZhi.wuXing == '火'" style="color: #d10600;">{{baziInfo.nianZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.nianZhu.diZhi.wuXing == '土'" style="color: #876d07;">{{baziInfo.nianZhu.diZhi.diZhi}}</view>
						
					</view>
					<view class="item">
						<view v-if="baziInfo.yueZhu.diZhi.wuXing == '金'" style="color: #e7950e;">{{baziInfo.yueZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.yueZhu.diZhi.wuXing == '木'" style="color: #2de24e;">{{baziInfo.yueZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.yueZhu.diZhi.wuXing == '水'" style="color: #3083f7;">{{baziInfo.yueZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.yueZhu.diZhi.wuXing == '火'" style="color: #d10600;">{{baziInfo.yueZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.yueZhu.diZhi.wuXing == '土'" style="color: #876d07;">{{baziInfo.yueZhu.diZhi.diZhi}}</view>
						
					</view>
					<view class="item">
						<view v-if="baziInfo.riZhu.diZhi.wuXing == '金'" style="color: #e7950e;">{{baziInfo.riZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.riZhu.diZhi.wuXing == '木'" style="color: #2de24e;">{{baziInfo.riZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.riZhu.diZhi.wuXing == '水'" style="color: #3083f7;">{{baziInfo.riZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.riZhu.diZhi.wuXing == '火'" style="color: #d10600;">{{baziInfo.riZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.riZhu.diZhi.wuXing == '土'" style="color: #876d07;">{{baziInfo.riZhu.diZhi.diZhi}}</view>
						
					</view>
					<view class="item">
						<view v-if="baziInfo.shiZhu.diZhi.wuXing == '金'" style="color: #e7950e;">{{baziInfo.shiZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.shiZhu.diZhi.wuXing == '木'" style="color: #2de24e;">{{baziInfo.shiZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.shiZhu.diZhi.wuXing == '水'" style="color: #3083f7;">{{baziInfo.shiZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.shiZhu.diZhi.wuXing == '火'" style="color: #d10600;">{{baziInfo.shiZhu.diZhi.diZhi}}</view>
						<view v-if="baziInfo.shiZhu.diZhi.wuXing == '土'" style="color: #876d07;">{{baziInfo.shiZhu.diZhi.diZhi}}</view>
						
					</view>
					<view class="item">
						{{currentnian.daYun.slice(1,2)}}
					</view>
					<view class="item">
						{{baziInfo.liuNianDiZhi}}
					</view>
					<view class="item">
						{{baziInfo.liuYueDiZhi}}
					</view>
					
				</view>
				<view class="canggan">
					<view class="title item">
							臧干
					</view>
									
					<view class="item">
							<view class="item_i"   v-for="(item,index) in cangGan.nianGan">
								{{item}}
							</view>
					</view>
					<view class="item">
							<view class="item_i" v-for="(item,index) in cangGan.yueGan">
								{{item}}
						    </view>
					 </view>
					 <view class="item">
							<view class="item_i" v-for="(item,index) in cangGan.riGan">
								{{item}}
							</view>
					 </view>
					  <view class="item">
							<view class="item_i" v-for="(item,index) in cangGan.shiGan">
								{{item}}
							</view>
					  </view>
					  <view class="item">
					  	{{currentnian.daYunShiShenDiZhi}}
					  </view>
					  <view class="item">
					  	{{baziInfo.liuNianDiZhiShiShen}}
					  </view>
					  <view class="item">
					  	{{baziInfo.liuYueDiZhiShiShen}}
					  </view>
				</view>
				
				<view class="dayun">
					<view class="title">
						<view class="t_left">
							大运
						</view>
						<view class="t_right">
							{{liunianlist[0].startYear}}年{{liunianlist[0].startYear.startMonth}}月 <span>({{liunianlist[0].startBirYear}}岁{{liunianlist[0].startBirMonth}}个月) </span> 起运
						</view>
					</view>
					<view class="dayunlist">
						<view @click="changeduyun(index)" class="item" v-for="(item,index) in liunianlist" :key="index">
							<view class="date">
								<view class="sui">
									{{item.startYear}} <span>始</span>
								</view>
								<view class="nian">
									{{item.startBirYear}} <span>岁</span>
								</view>
							</view>
							<view :class="item.currDaYun ? 'name active':'name'">
								{{item.daYun}}
							</view>
						</view>
					</view>
				
					
				</view>
				<view class="liunian">
					<view class="title">
						<view class="t_left">
							流年
						</view>
						<view class="t_right">
						</view>
					</view>
					<view class="liunianlist">
						<view @click="changeliunian(index)" class="item" v-for="(item,index) in liunianlist[number2].liuNianList" :key="index">
							<view  class="date">
								<view class="sui">
									{{item.year}}  
								</view>
								<view :class="item.isCurrYear?' activenian':'nian'" >
									{{item.yearStr}}  
								</view>
							</view>
							
						</view>
					</view>
				</view>
				<view class="liuyue">
					<view class="title">
						<view class="t_left">
							流月
						</view>
						<view class="t_right">
						</view>
					</view>
					<view class="liuyuelist">
						<view class="liuyue">
							
						 
						<view @click="changliuyue(index)" class="item" v-for="(item,index) in liuyuelist" :key="index">
							<view class="jieqi">
								<span class="tetxx">{{item.jieQieMonth}}</span>
								<view class="">
									{{item.dateStr}}
								</view>
							</view>
							<view  :class="item.isCurrMonth?'active':'nian'">
								<view class="">
									{{item.yueGan}}
								</view>
								<view class="">
									{{item.yueZhi}}
								</view>
							</view>
						</view>
						</view>
					</view>
				</view>
			
			</view>
		</view>
		</view>
		<view class="report_change flex_row_center_center"  v-if="auditShow &&false" @click="userChange">
			<image class="report_change_icon" src="https://sy-hws-file-oss.oss-cn-beijing.aliyuncs.com/yijing/change_icon.png" mode="aspectFit"></image>
		    <view>切换档案生成新的报告</view>
		</view>
		
	 
		
	</view>
</template>

<script>
	import {mapState,mapMutations} from 'vuex'
	import other from '@/components/other/index.vue'
	export default{
		components:{other},
		data(){
			return{
				url:'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132',
				useInfo:"",
				dataInfo:{},
				baziInfo:{},//八字五行 天干地支
				shishen:{},//十神
				cangGan:{},//藏干
				nayin:{},//纳音
				changsheng:{},//长生
				liunianindex:{},//当前流年
				liunianlist:[],//流年
				currentnian:{},//当前大运
				number2:0,//默认流年
				liunianlistt:[],
				idcard:false,//身份卡片
				numCount:{
					jin:0,
					mu:0,
					shui:0,
					huo:0,
					tu:0,
				},
				auditShow:true,
				shiyelist:[],//事业
				// 1111
				number1:0,
				uerinfo:{},//用户信息
				liuyuelist:[],//流年的流月
				currnian:'',//当前年份
				statusBarHeight:null,
				nianZhuTian:{},
				yueZhuTian:{},
				riZhuTian:{},
				shiZhuTian:{},
				nianZhuDi:{},
				yueZhuDi:{},
				riZhuDi:{},
				shiZhuDi:{}
			
			}
		},
		onLoad(options){
			if('idinfo' in options){
				 let boj=JSON.parse(decodeURIComponent(options.idinfo ))
				 let data={
				 	name:boj.masterName,
				 	year:boj.masterBirthday.split(' ')[0].split('/')[0],
				 	month:boj.masterBirthday.split(' ')[0].split('/')[1],
				 	day:boj.masterBirthday.split(' ')[0].split('/')[2],
				 	hour:boj.masterBirthday.split(' ')[1].split(':')[0],
				 	minute:boj.masterBirthday.split(' ')[1].split(':')[1],
				 	selectAddressCode:boj.masterAddressCode,
				 	// selectAddress:boj.masterAddress,
				 	gender:boj.masterSex,
				 	isLeap:boj.isLeap
				 }
				 this.useInfo=boj
				 if(data.isLeap === null){
				 	this.getFortune(data)
				 }else if(data.isLeap.toString() =='true' ||data.isLeap.toString() =='false'){
				 	 this.getFortune2(data)
				 }
				  
			}
		},
		onShow(){
			
		    // this.getAudit()
			// this.getUserInfo();
		},
		// 下拉刷新
		
		computed: {
			...mapState(['hasLogin', 'userInfo', 'userCenterData'])
		},
		methods:{
			left(){
				uni.navigateBack({delta:1})
			},
			// 大运切换
			changeduyun(idx){
				this.liunianlist.forEach((item,index)=>{
					if(idx==index){
						item.currDaYun=true
						this.number2=idx
					}else{
						item.currDaYun=false
					}
				})
				// this.$set(this.liunianlist[idx],'currDaYun',true)
			},
			changeliunian(idx){
				 this.liunianlist[this.number2].liuNianList.forEach((item,index)=>{
					 if(idx==index){
						 item.isCurrYear=true
					 }else{
						 item.isCurrYear=false
					 }
				 })
				this.currnian=this.liunianlist[this.number2].liuNianList[idx].year
			   this.getliuyuelist(this.currnian)
			},
			changliuyue(idx){
				this.liuyuelist.forEach((item,index)=>{
					if(idx==index){
						item.isCurrMonth=true
					}else{
						item.isCurrMonth=false
					}
				})
			},
			// 获取流月信息
			getliuyuelist(value){
				  
				let param={}
				param.urls='scbz/getLiuYue',
				// param.method="GET"
				param.data={year:value,riYuan:this.baziInfo.riZhu.tianGan.tianGan}
				param.headers={
					'Content-Type': 'application/json;charset=utf-8',
				}
				this.$request(param).then(res=>{
					this.liuyuelist=res.liuYueByYear
				})
			},
			//跳转
			tomore(){
				uni.navigateTo({
					url:"/pages/moreModule/paipanjiedu/paipanjiedu"
				})
			},
			
			
			//获取微信审核开关
			getAudit(){
			    let param = {};
				param.url='v3/system/front/configuration/1'
				this.$request(param).then(res=>{
					this.statusBarHeight=uni.getSystemInfoSync().statusBarHeight
					this.auditShow=res.data.auditSwitch
					// if(this.auditShow){
					// 	uni.setNavigationBarTitle({
					// 		title:'八字排盘'
					// 	})
					// }
					
				})
			},
			getUserInfo(){
				if(!this.hasLogin){
					this.useInfo=uni.getStorageSync('exampleInfo')
					
					let data={
						name:this.useInfo.masterName,
						year:this.useInfo.masterBirthday.split(' ')[0].split('/')[0],
						month:this.useInfo.masterBirthday.split(' ')[0].split('/')[1],
						day:this.useInfo.masterBirthday.split(' ')[0].split('/')[2],
						hour:this.useInfo.masterBirthday.split(' ')[1].split(':')[0],
						minute:this.useInfo.masterBirthday.split(' ')[1].split(':')[1],
						selectAddressCode:this.useInfo.masterAddressCode,
						selectAddress:this.useInfo.masterAddress,
						gender:this.useInfo.masterSex,
						isLeap:this.useInfo.isLeap
					}
					
					if(data.isLeap === null){
						this.getFortune(data)
					}else if(data.isLeap.toString() =='true' ||data.isLeap.toString() =='false'){
						 this.getFortune2(data)
					}
				}else{
					let param = {};
					param.url='v3/member/front/master/detail'
					this.$request(param).then(res =>{
						console.log(res);
						if(res.data){
							this.useInfo=res.data
							let data={
								name:res.data.masterName,
								year:res.data.masterBirthday.split(' ')[0].split('/')[0],
								month:res.data.masterBirthday.split(' ')[0].split('/')[1],
								day:res.data.masterBirthday.split(' ')[0].split('/')[2],
								hour:res.data.masterBirthday.split(' ')[1].split(':')[0],
								minute:res.data.masterBirthday.split(' ')[1].split(':')[1],
								selectAddressCode:res.data.masterAddressCode,
								selectAddress:res.data.masterAddress,
								gender:res.data.masterSex,
								isLeap:res.data.isLeap
							}
							
							if(res.data.isLeap === null){
								this.getFortune(data)
							}else if(res.data.isLeap.toString() =='true' ||res.data.isLeap.toString() =='false'){
								 this.getFortune2(data)
							}
						}else{
							this.useInfo=uni.getStorageSync('exampleInfo')
							let data={
								name:this.useInfo.masterName,
								year:this.useInfo.masterBirthday.split(' ')[0].split('/')[0],
								month:this.useInfo.masterBirthday.split(' ')[0].split('/')[1],
								day:this.useInfo.masterBirthday.split(' ')[0].split('/')[2],
								hour:this.useInfo.masterBirthday.split(' ')[1].split(':')[0],
								minute:this.useInfo.masterBirthday.split(' ')[1].split(':')[1],
								selectAddressCode:this.useInfo.masterAddressCode,
								selectAddress:this.useInfo.masterAddress,
								gender:this.useInfo.masterSex,
								isLeap:this.useInfo.isLeap
							}
							
							if(data.isLeap === null){
								this.getFortune(data)
							}else if(data.isLeap.toString() =='true' ||data.isLeap.toString() =='false'){
								 this.getFortune2(data)
							}
						}
					})
				}
			},
			//阳历获取天干
			getFortune(value){
				// console.log('qe');
				// console.log('value',value);
				let param = {};
				param.urls='scbz/convertedCalendar'
				param.data=value
				param.header={
					'Content-Type': 'application/json;charset=utf-8',
				}
				this.$request(param).then(res=>{
					// console.log('res1',res);
					this.dataInfo=res
					this.currnian=res.currentYear
					// 数据处理
					const regex = /\d+\./g;
					const array1 = this.dataInfo.shiYe.split(regex).filter(Boolean);
					this.shiyelist=array1.map((item, index) => `${index + 1}.${item}`);
					// console.log(this.shiyelist,'222');
					this.baziInfo=res.baZiWuXing
					this.nianZhuTian=res.baZiWuXing.nianZhu.tianGan
					this.yueZhuTian=res.baZiWuXing.yueZhu.tianGan
					this.riZhuTian=res.baZiWuXing.riZhu.tianGan
					this.shiZhuTian=res.baZiWuXing.shiZhu.tianGan
					this.nianZhuDi=res.baZiWuXing.nianZhu.diZhi
					this.yueZhuDi=res.baZiWuXing.yueZhu.diZhi
					this.riZhuDi=res.baZiWuXing.riZhu.diZhi
					this.shiZhuDi=res.baZiWuXing.shiZhu.diZhi
					this.shishen=res.shiShen
					this.cangGan=res.cangGan
					this.nayin=res.naYin
					this.changsheng=res.changSheng
					this.liunianlist=res.liuNians
					this.liunianlist.forEach((item,index)=>{
						 
						if(item.currDaYun){
							 
							this.currentnian=item
							this.number2=index
						}
					})
					this.getliuyuelist(this.currnian)
					this.getNum()
					
				})
			},
			//阴历获取天干
			getFortune2(value){
			
				let param = {};
				param.urls='scbz/convertedSolarCalendar'
				param.data=value
				param.header={
					'Content-Type': 'application/json;charset=utf-8',
				},
				this.$request(param).then(res=>{
					 
					this.dataInfo=res
					this.currnian=res.currentYear
					this.baziInfo=res.baZiWuXing
					this.nianZhuTian=res.baZiWuXing.nianZhu.tianGan
					this.yueZhuTian=res.baZiWuXing.yueZhu.tianGan
					this.riZhuTian=res.baZiWuXing.riZhu.tianGan
					this.shiZhuTian=res.baZiWuXing.shiZhu.tianGan
					this.nianZhuDi=res.baZiWuXing.nianZhu.diZhi
					this.yueZhuDi=res.baZiWuXing.yueZhu.diZhi
					this.riZhuDi=res.baZiWuXing.riZhu.diZhi
					this.shiZhuDi=res.baZiWuXing.shiZhu.diZhi
					this.shishen=res.shiShen
					this.cangGan=res.cangGan
					this.nayin=res.naYin
					this.changsheng=res.changSheng
					this.liunianlist=res.liuNians
					this.liunianlist.forEach((item,index)=>{
						 
						if(item.currDaYun){
							this.currentnian=item
							this.number2=index
						}
					})
					this.getliuyuelist(this.currnian)
					this.getNum()
				})
			},
			getNum(){
				let arr=[]
				this.numCount.jin=0
				this.numCount.mu=0
				this.numCount.shui=0
				this.numCount.huo=0
				this.numCount.tu=0

				arr.push(this.baziInfo.nianZhu.tianGan.wuXing)
				arr.push(this.baziInfo.yueZhu.tianGan.wuXing)
				arr.push(this.baziInfo.riZhu.tianGan.wuXing)
				arr.push(this.baziInfo.shiZhu.tianGan.wuXing)
				arr.push(this.baziInfo.nianZhu.diZhi.wuXing)
				arr.push(this.baziInfo.yueZhu.diZhi.wuXing)
				arr.push(this.baziInfo.riZhu.diZhi.wuXing)
				arr.push(this.baziInfo.shiZhu.diZhi.wuXing)
				console.log('arr',arr);
				arr.forEach((item)=>{
					if(item=='金'){
						this.numCount.jin+=1
					}else if(item=='木'){
						this.numCount.mu+=1
					}else if(item=='水'){
						this.numCount.shui+=1
					}else if(item=='火'){
						this.numCount.huo+=1
					}else if(item=='土'){
						this.numCount.tu+=1
					}
				})
			},
			userChange(){
				this.$tab.navigateTo('/pages/index/archives')
			},
		}
	}
</script>

<style lang="scss">
	page{
		width: 100%;
		text-align: center;
		background-color: #fff;
	}
	 
	.constellation{
		padding:0 28rpx 28rpx;
		width: 100%;
		border-radius: 12rpx;
		background-color: #fff;
		// newpage
		.title_box{
			padding: 0 20rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.left{
				display: flex;
				align-items: center;
				.left_text{
					font-size: 30rpx !important;
					margin-right: 10rpx;
					
				}
				.left_icon{
					width: 30rpx;
					height: 30rpx;
					text-align: center;
					line-height: 30rpx;
					border: 2rpx solid #323333;
					border-radius: 50%;
					
				}
				
			}
		}
		.idcard{
			text-align: left;
		}
		// cont
		.cont_box{
			padding: 20rpx;
			.tab{
				display: flex;
				justify-content: space-between;
			  .tab_left{
				  display: flex;
				  justify-content: space-between;
			     font-size: 28rpx;
				 letter-spacing: 4rpx;
				  .shengchen{
					  margin-right: 50rpx;
				  }
				  .active{
					  font-size: 28rpx;
					  font-weight: 550;
					  .line{
						  border-bottom: 6rpx solid #38bedc;
					  }
				  }
			  }
			}
			// 排盘
			.paipan{
				padding:30rpx 10rpx;
				
				.ganshen,.tiangan,.dizhi,.znaggan,.naYins,.changheng{
					display: flex;
					justify-content: space-between;
					background-color: #f3f0e9;
					padding: 30rpx;
					.item{
						width: 24%;
						text-align: center;
						font-size: 26rpx;
					}
				}
				.pai_title{
					display: flex;
					justify-content: space-between;
					background-color: #f3f0e9;
					padding: 30rpx 10rpx 10rpx;
					border-radius: 20rpx 20rpx 0 0;
					.item{
						width: 24%;
						text-align: center;
						font-size: 26rpx;
						font-weight: 550;
					}
				}
				.changheng{
					padding: 10rpx 10rpx 30rpx;
					border-radius: 0 0 20rpx 20rpx;
				}
				.tiangan,.dizhi{
					background-color: #f6f5f1;
				}
				.naYins,.changheng{
					background-color: #f6f5f1;
				}
				.naYins{
					.item{
						color: #d8c2ab;
					}
					.title{
						color: #323333;
					}
				}
			}
			// 解读
			.jiedu{
				padding: 20rpx 40rpx;
				border-radius: 20rpx;
				box-shadow: 3rpx 3rpx 5rpx 5rpx rgba(0, 0, 0, .2);
			   .top{
				   display: flex;
				   justify-content: space-between;
				  .title{
				  	font-size: 28rpx;
				  	font-weight: 550;
				  } 
				  .more{
					  .button{
						  padding: 10rpx 20rpx;
						  border-radius: 28rpx;
						  letter-spacing: 4rpx;
						  color: #38bedc;
						  font-size: 26rpx;
						  border: 2rpx solid #38bedc;
					  }
				  }
				  
			   }
			   .cont_text{
			   	 padding: 20rpx 0 10rpx;
			   	 letter-spacing: 6rpx;
				 color: #575959;
			   }
			   // 提示
			   .warn_text{
				 border-top: 2rpx solid #cecece;
			   	padding: 10rpx 0rpx;
			   	margin-top: 10rpx;
			   	padding-bottom: 50rpx;
			   	font-size: 24rpx;
			   	// font-weight: 550;
			   	letter-spacing: 2rpx;
			   	line-height: 40rpx;
				color: #949696;
			   }
				
			}
			.dayunpaipan{
				// padding: 20rpx;
				padding-top: 20rpx;
				.cont_box{
					padding: 20rpx 0;
					background-color: #f3f0e9;
					border-radius: 20rpx;
					.title_tab{
						display: flex;
						justify-content: space-between;
						padding: 10rpx;
						background-color: #f3f0e9;
						border-radius: 20rpx 20rpx 0 0;
						.item{
							width: 12%;
						}
					}
					.ganshen,.tiangan,.dizhi,
					.canggan,.dayunlist,.liunianlist{
						display: flex;
						justify-content: space-between;
						padding: 10rpx;
						background-color: #f3f0e9;
						// border-radius: 20rpx 20rpx 0 0;
						.item{
							width: 13%;
							text-align: center;
							 .active{
								 background-color: #c9863f;
								 color: #fff;
								 font-size: 30rpx;
								 font-weight: 550;
								 border-radius: 30rpx;
								 padding: 4rpx 0;
							 }
							 .activenian{
								 background-color: #c9863f;
								 color: #fff;
								  padding: 4rpx 0;
								  border-radius: 20rpx;
								  font-size: 30rpx;
								  font-weight: 550;
							 }
						}
						
					}
					.liuyuelist{
						background-color: #f3f0e9;
						white-space: nowrap;
						overflow: hidden;
						.liuyue{
							overflow-x: scroll;
							box-sizing: border-box;
							overflow-y: hidden;
							-webkit-overflow-scrolling: touch;
							.jieqi{
								padding-bottom: 10rpx;
							}
						.item{
							display: inline-block;
							 font-size: 24rpx;
							 text-align: center;
							 padding: 0 10rpx;
							 .nian{
								 display: inline-block;
								  display: flex;
								  align-items: center;
								  flex-direction: column;
								 align-items: center; 
							 }
							 .active{
								 display: inline-block;
								  display: flex;
								  align-items: center;
								  flex-direction: column;
								 align-items: center; 
							 		 background-color: #c9863f;
							 		 color: #fff;
							 		 font-size: 24rpx;
							 		 font-weight: 550;
							 		 border-radius: 20rpx;
							 		 
							 }
						}
						}
						
					}
					.canggan{
						font-size: 20rpx;
						.item{
							width: 15%;
						}
						.title{
							font-size: 24rpx;
						}
					}
					.tiangan,.dizhi{
						.item{
							font-size: 28rpx;
							font-weight: 550;
						}
						.title{
							font-size: 24rpx;
							font-weight: 500;
						}
					}
					.dayun,.liunian,.liuyue{
						.title{
							display: flex;
							justify-content: space-between;
							padding: 20rpx;
							background-color: #f3f0e9;
							font-size: 24rpx;
						}
					}
				}
			}
		}
	}


	
	
	 
	 
 
</style>